package com.config.demo.model;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @ConfigurationProperties 读取配置文件属性
 * @Component 注册组件
 */
@Data
@Component
@ConfigurationProperties(prefix = "my.user")
public class User {
    //名称
    private String name;
    //性别
    private Boolean sex;
    //年龄
    private Integer age;
    //手机号
    private String mobile;
    //出生年月
    private Date birth;
    //爱好
    private String[] hobby;
    //家人
    private List<String> famliy;
    //分数
    private Map<String, Object> score;
    //薪水
    private Set<Double> salarys;
    //汽车
    private Car car;
    //车库
    private Map<String, List<Car>> cars;

}
